﻿using System.Xml.Serialization;

namespace SilverCrmSoap.FetchXml
{
    public enum IntBool
    {
        [XmlEnum("0")] False,
        [XmlEnum("1")] True
    }
        
    public enum Aggregate
    {
        [XmlEnum("count")] Count,
        [XmlEnum("countcolumn")] CountColumn,
        [XmlEnum("sum")] Sum,
        [XmlEnum("avg")] Average,
        [XmlEnum("min")] Minimum,
        [XmlEnum("max")] Maximum,
    }
        
    public enum FetchBool
    {
        [XmlEnum("true")] True,
        [XmlEnum("false")] False,
        [XmlEnum("1")] On,
        [XmlEnum("0")] Off
    }

    public enum DateGrouping
    {
        [XmlEnum("day")] Day,
        [XmlEnum("week")] Week,
        [XmlEnum("month")] Month,
        [XmlEnum("quarter")] Quarter,
        [XmlEnum("year")] Year,
        [XmlEnum("fiscal-period")] FiscalPeriod,
        [XmlEnum("fiscal-year")] FiscalYear
    }   

    [XmlType(AnonymousType = true)]
    public enum FilterJoinType
    {
        [XmlEnum("and")] And,
        [XmlEnum("or")] Or
    }

    [XmlType(TypeName="operator")]
    public enum Operator
    {
        eq,
        neq,
        ne,
        gt,
        ge,
        le,
        lt,
        like,
        [XmlEnum("not-like")] notlike,
        @in,
        [XmlEnum("not-in")] notin,
        between,
        [XmlEnum("not-between")] notbetween,
        @null,
        [XmlEnum("not-null")] notnull,
        yesterday,
        today,
        tomorrow,
        [XmlEnum("last-seven-days")] lastsevendays,
        [XmlEnum("next-seven-days")] nextsevendays,
        [XmlEnum("last-week")] lastweek,
        [XmlEnum("this-week")] thisweek,
        [XmlEnum("next-week")] nextweek,
        [XmlEnum("last-month")] lastmonth,
        [XmlEnum("this-month")] thismonth,
        [XmlEnum("next-month")] nextmonth,
        on,
        [XmlEnum("on-or-before")] onorbefore,
        [XmlEnum("on-or-after")] onorafter,
        [XmlEnum("last-year")] lastyear,
        [XmlEnum("this-year")] thisyear,
        [XmlEnum("next-year")] nextyear,
        [XmlEnum("last-x-hours")] lastxhours,
        [XmlEnum("next-x-hours")] nextxhours,
        [XmlEnum("last-x-days")] lastxdays,
        [XmlEnum("next-x-days")] nextxdays,
        [XmlEnum("last-x-weeks")] lastxweeks,
        [XmlEnum("next-x-weeks")] nextxweeks,
        [XmlEnum("last-x-months")] lastxmonths,
        [XmlEnum("next-x-months")] nextxmonths,
        [XmlEnum("olderthan-x-months")] olderthanxmonths,
        [XmlEnum("last-x-years")] lastxyears,
        [XmlEnum("next-x-years")] nextxyears,
        [XmlEnum("eq-userid")] equserid,
        [XmlEnum("ne-userid")] neuserid,
        [XmlEnum("eq-userteams")] equserteams,
        [XmlEnum("eq-businessid")] eqbusinessid,
        [XmlEnum("ne-businessid")] nebusinessid,
        [XmlEnum("eq-userlanguage")] equserlanguage,
        [XmlEnum("this-fiscal-year")] ThisFiscalYear,
        [XmlEnum("this-fiscal-period")] ThisFiscalPeriod,
        [XmlEnum("next-fiscal-year")] NextFiscalYear,
        [XmlEnum("next-fiscal-period")] NextFiscalPeriod,
        [XmlEnum("last-fiscal-year")] LastFiscalYear,
        [XmlEnum("last-fiscal-period")] LastFiscalPeriod,
        [XmlEnum("last-x-fiscal-years")] LastXFiscalYears,
        [XmlEnum("last-x-fiscal-periods")] LastXFiscalPeriods,
        [XmlEnum("next-x-fiscal-years")] NextXFiscalYears,
        [XmlEnum("next-x-fiscal-periods")] NextXFiscalPeriods,
        [XmlEnum("in-fiscal-year")] InFiscalYear,
        [XmlEnum("in-fiscal-period")] InFiscalPeriod,
        [XmlEnum("in-fiscal-period-and-year")] InFiscalPeriodAndYear,
        [XmlEnum("in-or-before-fiscal-period-and-year")] InOrBeforeFiscalPeriodAndYear,
        [XmlEnum("in-or-after-fiscal-period-and-year")] InOrAfterFiscalPeriodAndYear,
        [XmlEnum("begins-with")] BeginsWith,
        [XmlEnum("not-begin-with")] NotBeginWith,
        [XmlEnum("ends-with")] EndsWith,
        [XmlEnum("not-end-with")] NotEndWith
    }

    [XmlType(AnonymousType = true)]
    public enum Mapping
    {
        [XmlEnum("internal")] Internal,
        [XmlEnum("logical")] Logical
    }

    [XmlType(AnonymousType = true)]
    public enum OutputFormat
    {
        [XmlEnum("xml-ado")] XmlADO,
        [XmlEnum("xml-auto")] XmlAuto,
        [XmlEnum("xml-elements")] XmlElements,
        [XmlEnum("xml-raw")] XmlRaw,
        [XmlEnum("xml-platform")] XmlPlatform
    }
    
}